/**
 * 
 */
package org.wangh.db.datatype;

/**
 * @author wang
 *
 */
public class DataType_Varchar extends AbstractDataType {
	
	private final int length;

	protected DataType_Varchar(String name, String sqlType, int length, String attribute) {
		super(name, sqlType, attribute);
		this.length = length;
	}

	public int getLength() {
		return length;
	}

	@Override
	public String getDescription() {
		if(attribute == null){
			return name + " " + sqlType + "(" + length + ")";
		}
		else{
			return name + " " + sqlType + "(" + length + ")" + " " + attribute;
		}
	}
	
	

}
